package com.java.base.exercise.designmode.builder;

/**
 * @Author RenPu
 * @Date 2023/4/19 16:19
 * @Version 1.0
 * @Description:
 **/
public class Personal {

    private String name;
    private String address;

    public Personal() {
    }


    public String getName() {
        return name;
    }

    public String getAddress() {
        return address;
    }

//    public void setName(String name) {
//        this.name = name;
//    }
//
//    public void setAddress(String address) {
//        this.address = address;
//    }

    public Personal name(String name){
        name(name);
        return this;
    }

    public Personal address(String address){
        address(address);
        return this;
    }


    @Override
    public String toString() {
        return "Personal{" +
                "name='" + name + '\'' +
                ", address='" + address + '\'' +
                '}';
    }


    public static void main(String[] args) {
        Personal personal = new Personal();
        personal.name("nihao").address("北京");
        System.out.println(personal);
    }
}
